import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询列表
export function listCoupon(query) {
  return request({
    url: '/beauty/coupon/list',
    method: HttpMethod.GET,
    params: query
  })
}

// 查询
export function getCoupon(id) {
  return request({
    url: '/beauty/coupon/' + id,
    method: HttpMethod.GET
  })
}

// 新增
export function addCoupon(data) {
  return request({
    url: '/beauty/coupon',
    method: HttpMethod.POST,
    data: data
  })
}

// 删除
export function delCoupon(id) {
  return request({
    url: '/beauty/coupon/' + id,
    method: HttpMethod.DELETE
  })
}

// 下架卡券
export function downCoupon(couponId) {
  return request({
    url: `/beauty/coupon/down/${couponId}`,
    method: HttpMethod.PUT
  })
}
